var mongoose = require('mongoose')

var userSchema = new mongoose.Schema({
    'userId': Number,
    'userName': String,
    'userPwd': String,
    'orderList': Array,
    'avatar': String,
    'cartList': [
    {
        'productId': Number,
        'productName': String,
        'salePrice': Number,
        'productImage': String,
        'checked': String,
        'productNum': Number
    }
    ],
    'addressList': [
    {
        'addressId': String,
        'userName': String,
        'streetName': String,
        'postCode': Number,
        'tel': Number,
        'isDefault': Boolean
    }
    ]
})

module.exports = mongoose.model('User', userSchema, 'users')
